<?php defined('RUN_KATANA') or die('Restricted access'); ?>
<?php echo $commander->getListCommandsPanel('sa', ''); ?>
<div class="menu_list">
	<table style="clear:both;" id="orders_<?php echo $status; ?>" class="item_list" cellspacing="0" cellpadding="0" border="0">
        <thead class="fields">
            <tr>
                <th class="first center">&nbsp;&nbsp;Id&nbsp;&nbsp;</th>
                <th class="center nosort"><?php echo ucfirst($txt->getWord('view')); ?></th>
                <th><?php echo ucfirst($txt->getWord('date_ordered')); ?></th>
				<th><?php echo ucfirst($txt->getWord('delivery_date')); ?></th>
				<th><?php echo ucfirst($txt->getWord('payment_method')); ?></th>
				<th class="small-m"><?php echo ucfirst($txt->getWord('payment').' '.$txt->getWord('status')); ?></th>
				<th><?php echo ucfirst($txt->getWord('shipping_method')); ?></th>
				<th><?php echo ucfirst($txt->getWord('shipping').' '.$txt->getWord('zone')); ?></th>
				<th class="small-m"><?php echo ucfirst($txt->getWord('status')); ?></th>
				<!--<th class="header"><?php echo ucfirst($txt->getWord('edit')); ?></th>-->
				<th class="header"><?php echo ucfirst($txt->getWord('export')); ?>
				<th class="header last nosort"><?php echo ucfirst($txt->getWord('delete')); ?></th>
            </tr>
        </thead>
        <tbody><?php echo $commander->getComponentListLoading(); ?></tbody>
    </table>
</div>
<script type="text/javascript">
jQuery(document).ready(function() 
{
	jQuery.ajax(
	{
		url: "ajax.php?con=<?php echo $_GET['con']; ?>&m=<?php echo $_GET['m']; ?>&editor=list&list=orders&status=<?php echo $status; ?>",
		cache: false,
	  	success: function(html)
	  	{ 
			jQuery('table#orders_<?php echo $status; ?> tr.loading').remove();
			jQuery("table#orders_<?php echo $status; ?> tbody").append(html); 
			jQuery("table#orders_<?php echo $status; ?>").addClass('tablesorter');
			jQuery("table#orders_<?php echo $status; ?>").tablesorter(
				{
					widthFixed: true,  
					headers: { 0: { sorter: 'numeric' }, 1: { sorter: false}, 9: {sorter: false} }, 
					<?php 
					if($status == 2)
					{ echo 'sortList: [[2,0]],'; }
					else
					{ echo 'sortList: [[3,0]],'; }
					?>
					textExtraction: function(node) { return node.innerHTML; }
				})/*.tablesorterPager(
				{
					container: jQuery("div.pager")
				}).tablesorterFilter(
				{
					filterContainer: $("#filter-box"),
					filterClearContainer: $("#filter-clear-button"),
					filterWaitTime: 100,
					//filterColumns: [1],
					filterCaseSensitive: false
				})*/;
			jQuery('table#orders_<?php echo $status; ?>.item_list tr.loading').remove();
		}
	});
});
</script>